<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
  
 </body>
</html>
<script>
	//苹果3元一个，鸭梨2元一个，桃子1元一个。现在想用200元买100个水果，在控制台中列出所有可能性;
	//假设:apple X  pear Y   peach  Z
	// X + Y + Z == 100  &&  X*3 + Y*2 + Z*1 == 200
	//一个个去试 当苹果为1个的时候，试梨1-100，当梨1 试桃1-100
	//1000000

	for(var x = 0; x <= 100; x++){
		for(var y = 0; y <=100; y++){
			for(var z = 0; z <= 100; z++){
				if(x + y + z == 100 && x*3 + y*2 + z == 200){
					console.log(x, y, z);
				}
			}
		}
	}
</script>
